package com.company.calendar.controller;

import com.company.calendar.entity.HolidayType;
import com.company.calendar.mapper.HolidayTypeMapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 节假日类型控制器
 * 
 * @author System
 * @since 1.0.0
 */
@RestController
@RequestMapping("/holiday-types")
@RequiredArgsConstructor
@Slf4j
public class HolidayTypeController {
    
    private final HolidayTypeMapper holidayTypeMapper;
    
    /**
     * 获取所有节假日类型
     * 
     * @return 节假日类型列表
     */
    @GetMapping
    public ResponseEntity<List<HolidayType>> getAllHolidayTypes() {
        log.info("获取所有节假日类型");
        List<HolidayType> holidayTypes = holidayTypeMapper.findByIsDeletedFalse();
        return ResponseEntity.ok(holidayTypes);
    }
}
